//
//  NewFeatureVC.m
//  QBPatient
//
//  Created by 阳光 on 16/8/2.
//  Copyright © 2016年 QB. All rights reserved.
//

#import "NewFeatureVC.h"

@interface NewFeatureVC ()

@property(nonatomic,strong)UIScrollView *scrollView;

@end


@implementation NewFeatureVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    _scrollView=[[UIScrollView alloc]initWithFrame:self.view.bounds];
    [self.view addSubview:_scrollView];
    
    for (int i=0;i<_images.count;i++)
    {
        UIImageView *image=[[UIImageView alloc]initWithFrame:CGRectMake(i*APPW,0,APPW,APPH)];
        image.image=[UIImage imageNamed:_images[i]];
        [_scrollView addSubview:image];
        
        if (i==_images.count-1)
        {
            // 最后一页  进入呱呱
            UIButton *enterBtn=[UIButton buttonWithType:UIButtonTypeCustom];
            enterBtn.frame=CGRectMake(0,0,APPW,APPH);
            enterBtn.backgroundColor=ClearColor;
            image.userInteractionEnabled=YES;
            [image addSubview:enterBtn];
            [enterBtn addTarget:self action:@selector(startApp) forControlEvents:UIControlEventTouchUpInside];
       
        }
//        else
//        {//跳过;
//            
//            UIButton *enterBtn=[UIButton buttonWithType:UIButtonTypeCustom];
//            enterBtn.frame=CGRectMake((APPW*2)/3,0,APPW/3,APPH/3);
//            enterBtn.backgroundColor= ClearColor;
//            image.userInteractionEnabled=YES;
//            [image addSubview:enterBtn];
//            [enterBtn addTarget:self action:@selector(startApp) forControlEvents:UIControlEventTouchUpInside];
//            
//        }
        
    }
    _scrollView.contentSize=CGSizeMake(APPW*_images.count,0);
    _scrollView.pagingEnabled=YES;
    _scrollView.showsHorizontalScrollIndicator=NO;
    _scrollView.bounces=NO;
}

-(void)startApp
{
    _start();
}

@end
